//
//  Complaints_Message_TableViewCell.swift
//  Pods
//
//  Created by eme on 2017/4/11.
//
//

import UIKit

class Complaints_Message_TableViewCell: UITableViewCell {
    @IBOutlet weak var type_Label: UILabel!                 //投诉类型
    
    @IBOutlet weak var content_Label: UILabel!              //投诉内容
    
    @IBOutlet weak var content_Image1: UIImageView!         //投诉图片1
    
    @IBOutlet weak var content_Image2: UIImageView!         //投诉图片2
    
    @IBOutlet weak var content_Image3: UIImageView!         //投诉图片3
    
    @IBOutlet weak var SCPZ_Label: UILabel!
    
    @IBOutlet weak var image_Height: NSLayoutConstraint!
    
    var imageArr = [UIImageView]()
    
    var item:ComplaintsDetaileModel?{
        didSet{
            if let model = item{
                self.type_Label.text = model.osOrderComplainType.compainTypeName
                self.content_Label.text = model.complaincommnet
                if model.picurlArr.count == 1{
                    if model.picurlArr[0] != ""{
                        self.content_Image1.isHidden = false
                        self.content_Image1.setUrlImage(model.picurlArr[0])
                    }else{
                        self.image_Height.constant = 0
                        self.content_Image1.isHidden = true
                        self.content_Image2.isHidden = true
                        self.content_Image3.isHidden = true
                        self.SCPZ_Label.isHidden = true
                    }
                }else{
                    self.SCPZ_Label.isHidden = false
                    self.content_Image1.isHidden = false
                    self.content_Image2.isHidden = false
                    self.content_Image3.isHidden = false
                    for index in 0...model.picurlArr.count - 1{
                        if imageArr.count >= index{
                            imageArr[index].setUrlImage(model.picurlArr[index])
                        }
                    }
                }
            }
            
        }
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        imageArr = [content_Image1,content_Image2,content_Image3]
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
